﻿using Smalt.Data.Infrastructure;
using Smalt.DomainModels.Models;
using Smalt.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Smalt.Services
{
    public class TeamsService : ServiceBase, ITeamsService
    {
        public TeamsService(IUnitOfWork unitOfWork)
        {
            base.unitOfWork = unitOfWork;
        }

        public int Add(Team team)
        {
            base.unitOfWork.Teams.Add(team);
            base.unitOfWork.SaveChanges();

            return team.Id;
        }

        public IQueryable<Team> GetAll()
        {
            return base.unitOfWork.Teams.All();
        }
    }
}
